﻿using UnityEngine;
using System.Collections;

namespace ResourceClasses
{
	/// <summary>
	/// A list of resources for the rewards.
	/// </summary>
	public class Reward
	{
		private Resource[] resourceList;

		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceClasses.Reward"/> class.
		/// </summary>
		/// <param name="amount">Amount.</param>
		public Reward (Resource[] amount)
		{
			resourceList = new Resource[amount.Length];
			resourceList = amount;
		}
	
		/// <summary>
		/// Gets or sets the <see cref="ResourceClasses.Reward"/> at the specified index.
		/// </summary>
		/// <param name="index">Index.</param>
		public Resource this [int index] {
			get {
				return resourceList [index];
			}
			set {
				resourceList [index] = value;
			}
		}

		/// <summary>
		/// Returns a <see cref="System.String"/> that represents the current <see cref="ResourceClasses.Reward"/>.
		/// </summary>
		/// <returns>A <see cref="System.String"/> that represents the current <see cref="ResourceClasses.Reward"/>.</returns>
		public override string ToString ()
		{
			string resString = "Rewards:\n";
			foreach (Resource res in resourceList) {
				resString += res.ToString ();
			}
			return resString;
		}
	}
}
